{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import imblearn\n",
    "import numpy as np\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Loading data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "names = [\"duration\",\"protocol_type\",\"service\",\"flag\",\"src_bytes\",\n",
    "    \"dst_bytes\",\"land\",\"wrong_fragment\",\"urgent\",\"hot\",\"num_failed_logins\",\n",
    "    \"logged_in\",\"num_compromised\",\"root_shell\",\"su_attempted\",\"num_root\",\n",
    "    \"num_file_creations\",\"num_shells\",\"num_access_files\",\"num_outbound_cmds\",\n",
    "    \"is_host_login\",\"is_guest_login\",\"count\",\"srv_count\",\"serror_rate\",\n",
    "    \"srv_serror_rate\",\"rerror_rate\",\"srv_rerror_rate\",\"same_srv_rate\",\n",
    "    \"diff_srv_rate\",\"srv_diff_host_rate\",\"dst_host_count\",\"dst_host_srv_count\",\n",
    "    \"dst_host_same_srv_rate\",\"dst_host_diff_srv_rate\",\"dst_host_same_src_port_rate\",\n",
    "    \"dst_host_srv_diff_host_rate\",\"dst_host_serror_rate\",\"dst_host_srv_serror_rate\",\n",
    "    \"dst_host_rerror_rate\",\"dst_host_srv_rerror_rate\",\"target\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df = pd.read_csv('kddcup.csv', names=names)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df.drop('num_outbound_cmds', axis=1, inplace=True)\n",
    "df.drop('is_host_login', axis=1, inplace=True)\n",
    "df['protocol_type'] = df['protocol_type'].astype('category')\n",
    "df['service'] = df['service'].astype('category')\n",
    "df['flag'] = df['flag'].astype('category')\n",
    "cat_columns = df.select_dtypes(['category']).columns\n",
    "df[cat_columns] = df[cat_columns].apply(lambda x: x.cat.codes)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df.drop_duplicates(subset=None, keep='first', inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(145586, 40)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "target_count = df.target.value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "normal.             87832\n",
       "neptune.            51820\n",
       "back.                 968\n",
       "teardrop.             918\n",
       "satan.                906\n",
       "warezclient.          893\n",
       "ipsweep.              651\n",
       "smurf.                641\n",
       "portsweep.            416\n",
       "pod.                  206\n",
       "nmap.                 158\n",
       "guess_passwd.          53\n",
       "buffer_overflow.       30\n",
       "warezmaster.           20\n",
       "land.                  19\n",
       "imap.                  12\n",
       "rootkit.               10\n",
       "loadmodule.             9\n",
       "ftp_write.              8\n",
       "multihop.               7\n",
       "phf.                    4\n",
       "perl.                   3\n",
       "spy.                    2\n",
       "Name: target, dtype: int64"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "target_count"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Random under-sampling"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "count_class_normal, count_class_neptune, count_class_back, count_class_teardrop, count_class_satan, count_class_warezclient, count_class_ipsweep, count_class_smurf, count_class_portsweep, count_class_pod, count_class_nmap, count_class_guess_passwd, count_class_buffer_overflow, count_class_warezmaster, count_class_land, count_class_imap, count_class_rootkit, count_class_loadmodule, count_class_ftp_write, count_class_multihop, count_class_phf, count_class_perl, count_class_spy = df.target.value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Divide by class\n",
    "df_normal = df[df['target'] == 'normal.']\n",
    "df_neptune = df[df['target'] == 'neptune.']\n",
    "df_back = df[df['target'] == 'back.']\n",
    "df_teardrop = df[df['target'] == 'teardrop.']\n",
    "df_satan = df[df['target'] == 'satan.']\n",
    "df_warezclient = df[df['target'] == 'warezclient.']\n",
    "df_ipsweep = df[df['target'] == 'ipsweep.']\n",
    "df_smurf = df[df['target'] == 'smurf.']\n",
    "df_portsweep = df[df['target'] == 'portsweep.']\n",
    "df_pod = df[df['target'] == 'pod.']\n",
    "df_nmap = df[df['target'] == 'nmap.']\n",
    "df_guess_passwd = df[df['target'] == 'guess_passwd.']\n",
    "df_buffer_overflow = df[df['target'] == 'buffer_overflow.']\n",
    "df_warezmaster = df[df['target'] == 'warezmaster.']\n",
    "df_land = df[df['target'] == 'land.']\n",
    "df_imap = df[df['target'] == 'imap.']\n",
    "df_rootkit = df[df['target'] == 'rootkit.']\n",
    "df_loadmodule = df[df['target'] == 'loadmodule.']\n",
    "df_ftp_write = df[df['target'] == 'ftp_write.']\n",
    "df_multihop = df[df['target'] == 'multihop.']\n",
    "df_phf = df[df['target'] == 'phf.']\n",
    "df_perl = df[df['target'] == 'perl.']\n",
    "df_spy = df[df['target'] == 'spy.']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df_normal_under = df_normal.sample(count_class_neptune)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df_test_under = pd.concat([df_normal_under, df_neptune], axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Random under-sampling:\n",
      "neptune.    51820\n",
      "normal.     51820\n",
      "Name: target, dtype: int64\n"
     ]
    }
   ],
   "source": [
    "print('Random under-sampling:')\n",
    "print(df_test_under.target.value_counts())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAErCAYAAAA1wE/rAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAFuJJREFUeJzt3XuwZWV55/HvT1ouRqBRWka7iY3S\nTkQU1BaZaG4ygYZEoRJIcIy0DqmesqAmGVNGTKyARFNmqqKG8lIS6dhEDeItYMQwPajJWKJw8MJV\nQgei9DSRRhrEG0zrM3/s95Btv+f0Od00vU67v5+qXXuvZ71r7ec0m/M7a613752qQpKkcY8ZugFJ\n0sJjOEiSOoaDJKljOEiSOoaDJKljOEiSOoaDtIskWZLk1iT7Dt3LbJJ8PMmqofvQwmc4aI+S5L8k\nmUry3SR3Jfl0khfvhuetJIfPMewc4K+r6odtm88l+d1Hu7fZJDkvyQe2Kb8VeMsQ/WjPYjhoj5Hk\ntcA7gD8DDgF+Fng3cPKQfQEk2QdYDWz7y/iR7HPRrtrXtKq6BjggycpdvW/9dDEctEdIciBwPnBW\nVX28qr5XVf+vqj5ZVa9rY/ZJ8o4km9rtHe2XNkleleTz2+zz4aOBJO9P8q4kn0ryQJIvJXl6W/dP\nbZOvtSOW356hxRcC91XVxrbNW4BfAN7Ztnlnq/9lkjuTfCfJdUl+Yayf85J8NMkHknwHeFWS/ZKs\nS7IlyS1J/jD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WalNKtXAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xd9b2053a20>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from matplotlib import pyplot as plt\n",
    "my_colors = 'rgbkymc'\n",
    "df_test_under.target.value_counts().plot(kind='bar', title='Count (target)',  color=my_colors);\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Random oversampling"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df_neptune_over = df_neptune.sample(count_class_normal, replace=True)\n",
    "df_test_over = pd.concat([df_normal, df_neptune_over], axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Random over-sampling:\n",
      "normal.     87832\n",
      "neptune.    87832\n",
      "Name: target, dtype: int64\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAErCAYAAAA1wE/rAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAFZhJREFUeJzt3XuwZWV55/Hvz24BUaFBOow0xEZp\nYxBFSItEjcnIRBsTbSrBBMcoZkj1lAWTiykjJFZAYlLJ1MQL5aUkgkI0AQQm4KChGDSZsSTAaVCu\nEnroKB1QGmkuokJan/ljv022/Z7T59A0vc5xfz9Vu85az3rX2s/uXnV+Z1323qkqJEka95ShG5Ak\nzT+GgySpYzhIkjqGgySpYzhIkjqGgySpYzhIO0iSpUluS7Lb0L3MJMnFSVYN3YfmP8NBC0qS/5xk\nKsl3ktyd5PNJXrkTnreSHDTLsJOBT1TV99s6/5Dkt57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xCoXXjNUKMBw0HzxzbHozcBlw0UC9TCTDYQIl\nWQTcUFXvH7oXaQa3VNVnxgtJ3gh8Zobx2sG8lXUCVdUPgDcM3Ye0DafMsaYniUcOk+vLST4EnA88\nvKXod0hrSEmOBl4HLEtyxtiiPfCb4HYqw2Fyvbz9HP8I5AL8DmkN6S5gitGR7dqx+kPA7w3S0YTy\nTXCS5p0kT2X0BrgXMPqj5baqenTYriaL1xwmVJI9k7wvyVR7/GWSPYfuS2p+Efh/wBnAh4B17ZST\ndhKPHCZUkouAm4BzWuktwKFV9SvDdSWNJPka8MtVta7NPw+4rKpeMGxnk8NrDpPreVX1q2Pz70ny\nlcG6kX7UPVuCobmD0VfZaicxHCbX95K8sqq+BJDkFcD3Bu5J2uLmJJ8DLmB0zeGNwLVJfgV8J//O\n4GmlCZXkJYxOKW25zrAJON6vCtV8kOQT21jsl1LtBIbDhEqyK3As8DxgCaMvc6+qOn2bK0qaCN6t\nNLkuAV4PfB/4V+A7jL0ZThpSkucnuTLJTW3+xUnePXRfk8QjhwmV5KaqOmToPqTpJPlH4J3Ax6rq\nsFZzn92JPHKYXF9O8qLZh0mD2L2qrtmq5sdn7ETerTS5Xgm8Lcl6/JpQzT/3tvc2FECSY4G7h21p\nsnhaaUIlec509ar6+s7uRdpakucCZzL6DLBNwHrgze6fO4/hIGneGbubbjmwN/Ag3k23U3laSdJ8\ndAlwP3Ado09q1U7mkYOkecc7k4bn3UqS5iPvphuYRw6S5p0ktwAHMboQ7d10AzAcJM073k03PMNB\nktTxmoMkqWM4SJI6hoMkqWM4SJI6hoMkqfP/ARaUDnyWnyI3AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xd9b21487f0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "print('Random over-sampling:')\n",
    "print(df_test_over.target.value_counts())\n",
    "\n",
    "df_test_over.target.value_counts().plot(kind='bar', title='Count (target)', color=my_colors);\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from collections import Counter\n",
    "from imblearn.datasets import make_imbalance"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df_test = pd.concat([df_loadmodule, df_rootkit], axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df_test['target'] = df_test['target'].astype('category')\n",
    "cat_columns = df_test.select_dtypes(['category']).columns\n",
    "df_test[cat_columns] = df_test[cat_columns].apply(lambda x: x.cat.codes)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>duration</th>\n",
       "      <th>protocol_type</th>\n",
       "      <th>service</th>\n",
       "      <th>flag</th>\n",
       "      <th>src_bytes</th>\n",
       "      <th>dst_bytes</th>\n",
       "      <th>land</th>\n",
       "      <th>wrong_fragment</th>\n",
       "      <th>urgent</th>\n",
       "      <th>hot</th>\n",
       "      <th>...</th>\n",
       "      <th>dst_host_srv_count</th>\n",
       "      <th>dst_host_same_srv_rate</th>\n",
       "      <th>dst_host_diff_srv_rate</th>\n",
       "      <th>dst_host_same_src_port_rate</th>\n",
       "      <th>dst_host_srv_diff_host_rate</th>\n",
       "      <th>dst_host_serror_rate</th>\n",
       "      <th>dst_host_srv_serror_rate</th>\n",
       "      <th>dst_host_rerror_rate</th>\n",
       "      <th>dst_host_srv_rerror_rate</th>\n",
       "      <th>target</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>4049</th>\n",
       "      <td>79</td>\n",
       "      <td>1</td>\n",
       "      <td>56</td>\n",
       "      <td>9</td>\n",
       "      <td>281</td>\n",
       "      <td>1301</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>10</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86219</th>\n",
       "      <td>103</td>\n",
       "      <td>1</td>\n",
       "      <td>56</td>\n",
       "      <td>9</td>\n",
       "      <td>302</td>\n",
       "      <td>8876</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>147604</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>19</td>\n",
       "      <td>9</td>\n",
       "      <td>0</td>\n",
       "      <td>5921</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.67</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>147605</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>19</td>\n",
       "      <td>9</td>\n",
       "      <td>0</td>\n",
       "      <td>5014</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.50</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>147606</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>19</td>\n",
       "      <td>9</td>\n",
       "      <td>0</td>\n",
       "      <td>2072</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>5</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 40 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        duration  protocol_type  service  flag  src_bytes  dst_bytes  land  \\\n",
       "4049          79              1       56     9        281       1301     0   \n",
       "86219        103              1       56     9        302       8876     0   \n",
       "147604         0              1       19     9          0       5921     0   \n",
       "147605         0              1       19     9          0       5014     0   \n",
       "147606         0              1       19     9          0       2072     0   \n",
       "\n",
       "        wrong_fragment  urgent  hot   ...    dst_host_srv_count  \\\n",
       "4049                 0       0    2   ...                    10   \n",
       "86219                0       0    2   ...                     1   \n",
       "147604               0       0    0   ...                     3   \n",
       "147605               0       0    0   ...                     4   \n",
       "147606               0       0    1   ...                     5   \n",
       "\n",
       "        dst_host_same_srv_rate  dst_host_diff_srv_rate  \\\n",
       "4049                       1.0                     0.0   \n",
       "86219                      1.0                     0.0   \n",
       "147604                     1.0                     0.0   \n",
       "147605                     1.0                     0.0   \n",
       "147606                     1.0                     0.0   \n",
       "\n",
       "        dst_host_same_src_port_rate  dst_host_srv_diff_host_rate  \\\n",
       "4049                            1.0                         0.30   \n",
       "86219                           1.0                         0.00   \n",
       "147604                          1.0                         0.67   \n",
       "147605                          1.0                         0.50   \n",
       "147606                          1.0                         0.40   \n",
       "\n",
       "        dst_host_serror_rate  dst_host_srv_serror_rate  dst_host_rerror_rate  \\\n",
       "4049                     0.0                       0.0                   0.0   \n",
       "86219                    0.0                       0.0                   0.0   \n",
       "147604                   0.0                       0.0                   0.0   \n",
       "147605                   0.0                       0.0                   0.0   \n",
       "147606                   0.0                       0.0                   0.0   \n",
       "\n",
       "        dst_host_srv_rerror_rate  target  \n",
       "4049                         0.1       0  \n",
       "86219                        0.0       0  \n",
       "147604                       0.0       0  \n",
       "147605                       0.0       0  \n",
       "147606                       0.0       0  \n",
       "\n",
       "[5 rows x 40 columns]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_test.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "data = df_test.values\n",
    "Y = data[:,39]\n",
    "X = data[:,0:39]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(19, 39)"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "Y = Y.reshape(-1, 1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn.decomposition import PCA\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "\n",
    "sScaler = StandardScaler()\n",
    "rescaleX = sScaler.fit_transform(X)\n",
    "pca = PCA(n_components=2)\n",
    "rescaleX = pca.fit_transform(rescaleX)\n",
    "rescaleX = np.append(rescaleX, Y, axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "principalDf = pd.DataFrame(data = rescaleX, columns = ['principal component 1', 'principal component 2', 'target'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>principal component 1</th>\n",
       "      <th>principal component 2</th>\n",
       "      <th>target</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-0.074827</td>\n",
       "      <td>2.854827</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1.291615</td>\n",
       "      <td>4.483403</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-4.468923</td>\n",
       "      <td>1.584395</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-4.376407</td>\n",
       "      <td>1.320772</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-4.585688</td>\n",
       "      <td>2.086770</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   principal component 1  principal component 2  target\n",
       "0              -0.074827               2.854827     0.0\n",
       "1               1.291615               4.483403     0.0\n",
       "2              -4.468923               1.584395     0.0\n",
       "3              -4.376407               1.320772     0.0\n",
       "4              -4.585688               2.086770     0.0"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "principalDf.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.figure.Figure at 0x34ce6ad4a8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmMAAAGDCAYAAABnZBdiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAHiNJREFUeJzt3X905HV97/HXi2wsQ8GbKvFHAstq\nS1MtoKnxx1Vbf1GDSiXltirWH73Ws723eou3Nl4Dnrae6qW9uYfaqj12r78Vf9YQ7SoGaIuiLcpi\ngEghLVoRJigBjECZ2hDe94/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wiuIFrB7B9mqTzJT0rIpaz\n64Fke4eqJ1M8T1JZ0pWSXh4R16UWBkmSq/9X+SFJd0bEG7LrQX3FzNjvR8Tp2bVsV6wZAxr3LknH\nSLrE9tW235Nd0HZXnFDxeklzqi4O/xRBrKM8Q9IrJT23+DNzdTETA6AGM2MAAACJmBkDAABIRBgD\nAABIRBgDAABIRBgDAABIRBgDAABIRBgDgDpsf9H2iu292bUA6G2EMQCob1rVa2QBQEsRxgD0JNu7\nbN9g+0O2r7X917aPKl57su1/sH2N7a/bPubg90fE30q6u+2FA9h2CGMAetmIpD0RcYqkuyT9ju2H\nSPqkpLMj4gmSTpVUSawRwDZHGAPQy26OiK8Wjz8q6ZmqBrRbI+JKSYqIu4rbKgFACsIYgF528P3e\nQpLrjANAGsIYgF620/Z/Lh6fJekrkm6QNGT7yZJk+xjbO7IKBABuFA6gJ9neJekLkr4s6emS/kXS\nKyPi3iKIvVNSSdX1YqdGxD0Hvf9yST8n6WhJd0j6rYiYa9sXALBtEMYA9KQijO2NiJOSSwGADdGm\nBAAASMTMGAAAQCJmxgAAABIRxgAAABIRxgAAABIRxgAAABIRxgAAABIRxgAAABL9f8Q+I+6VMlxc\nAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x34ce6ad518>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.clf()\n",
    "plt.figure(figsize=(10,6))\n",
    "plt.scatter(principalDf.iloc[:,0], principalDf.iloc[:,1])\n",
    "plt.title('Principal component 1 vs 2')\n",
    "plt.xlabel(\"pc 1\")\n",
    "plt.ylabel(\"pc 2\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "data = principalDf.values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>principal component 1</th>\n",
       "      <th>principal component 2</th>\n",
       "      <th>target</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-0.074827</td>\n",
       "      <td>2.854827</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1.291615</td>\n",
       "      <td>4.483403</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-4.468923</td>\n",
       "      <td>1.584395</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-4.376407</td>\n",
       "      <td>1.320772</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-4.585688</td>\n",
       "      <td>2.086770</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0.049923</td>\n",
       "      <td>0.170846</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.196737</td>\n",
       "      <td>-1.027830</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0.089203</td>\n",
       "      <td>-1.163269</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>-0.471347</td>\n",
       "      <td>-1.202252</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>1.292547</td>\n",
       "      <td>-3.185521</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>1.083273</td>\n",
       "      <td>-2.429047</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>5.185817</td>\n",
       "      <td>2.267475</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>0.530970</td>\n",
       "      <td>-1.284119</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>4.336565</td>\n",
       "      <td>2.204245</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>-1.160869</td>\n",
       "      <td>0.581018</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>3.383620</td>\n",
       "      <td>-0.159761</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>0.572774</td>\n",
       "      <td>-3.122641</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>-1.192520</td>\n",
       "      <td>-2.030427</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>-1.682464</td>\n",
       "      <td>-1.948886</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    principal component 1  principal component 2  target\n",
       "0               -0.074827               2.854827     0.0\n",
       "1                1.291615               4.483403     0.0\n",
       "2               -4.468923               1.584395     0.0\n",
       "3               -4.376407               1.320772     0.0\n",
       "4               -4.585688               2.086770     0.0\n",
       "5                0.049923               0.170846     0.0\n",
       "6                0.196737              -1.027830     0.0\n",
       "7                0.089203              -1.163269     0.0\n",
       "8               -0.471347              -1.202252     0.0\n",
       "9                1.292547              -3.185521     1.0\n",
       "10               1.083273              -2.429047     1.0\n",
       "11               5.185817               2.267475     1.0\n",
       "12               0.530970              -1.284119     1.0\n",
       "13               4.336565               2.204245     1.0\n",
       "14              -1.160869               0.581018     1.0\n",
       "15               3.383620              -0.159761     1.0\n",
       "16               0.572774              -3.122641     1.0\n",
       "17              -1.192520              -2.030427     1.0\n",
       "18              -1.682464              -1.948886     1.0"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "principalDf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "label = data[:,2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  1.,  1.,  1.,  1.,\n",
       "        1.,  1.,  1.,  1.,  1.,  1.])"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "label"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.figure.Figure at 0x34ceccde80>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmMAAAF3CAYAAADpZ0xtAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi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GzBRP/ey3n4wyBjDplDFgpjihqn55z/dvSvL1JMdV1WlJUlXHVpWb\nmoBJ54PCgWmvqhYn+esktyf5t0n+b5LfSvKKJB9MMje714ud11p7pKruT/L8JHOS7Ejymtba3096\ncGBGUMaAaW9PGbultWarCmDguEwJANCRmTEAgI7MjAEAdKSMAQB0pIwBAHSkjAEAdKSMAQB0pIwB\nAHT0/wCs1+A+glCLuAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x34ceccd5f8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.clf()\n",
    "plt.figure(figsize = (10, 6))\n",
    "names = ['loadmodule', 'rootkit']\n",
    "colors = ['#1F77B4', '#FF7F0E']\n",
    "markers = ['o', 's']\n",
    "#label = numpy array of target column\n",
    "plt.xlabel('pc1')\n",
    "plt.ylabel('pc2')\n",
    "for i in range(len(names)):\n",
    "    bucket = principalDf[principalDf['target'] == i]\n",
    "    bucket = bucket.iloc[:,[0,1]].values\n",
    "    plt.scatter(bucket[:, 0], bucket[:, 1], c=colors[i], label=names[i], marker=markers[i]) \n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "data = principalDf.values\n",
    "Y = data[:,2]\n",
    "X = data[:,0:2]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Random under-sampling and over-sampling with imbalanced-learn\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 184,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Removed indexes: [    0     1     2 ..., 47440 22420  1780]\n"
     ]
    }
   ],
   "source": [
    "from imblearn.under_sampling import RandomUnderSampler\n",
    "\n",
    "rus = RandomUnderSampler(return_indices=True)\n",
    "X_rus, Y_rus, id_rus = rus.fit_sample(X, Y)\n",
    "\n",
    "print('Removed indexes:', id_rus)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 185,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "Y_rus = Y_rus.reshape(-1, 1)\n",
    "X_rus = np.append(X_rus, Y_rus, axis=1)\n",
    "principalDf = pd.DataFrame(data = X_rus, columns = ['principal component 1', 'principal component 2', 'target'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 189,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.figure.Figure at 0xd9d49fdc50>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmMAAAGDCAYAAABnZBdiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3X+clXWd9/H3Z4ZBBtFGFF0cQLAl\ndBWFGsPE3dS6JVOLyjKyVh97r9Sm92a17I0u94quFXe21l271UNvLTeN8FfjD9zVWrRSw3VwQCTk\nThSBwZRASmTUYeZz/3HOGc+cOdc51/n5PWfO6/l48HDmOte5ru+5mJh33+/n+/2auwsAAABhNIVu\nAAAAQCMjjAEAAAREGAMAAAiIMAYAABAQYQwAACAgwhgAAEBAhDGgwZjZv5vZhSVe48/NbFOZ2vOw\nmf11Oa4FAPWIMAbUOTPbYma9ZrbXzF4ysx+Y2bio8939LHe/uZR7uvuv3H1GKddAbma21MxuyXPO\npWbWZWZvmNkPq9Cmw81suZntMLM/mNmjZjan0vcFRjrCGDAynOvu4yS9U9JJkpZknmAJ/G9+ZNkh\n6RpJN1XpfuMkPSHpXZLGS7pZ0spc4R9AfvzDDIwg7t4j6d8lHS8NDgF+xcwelbRP0tHpw4JmdpGZ\nPWJm3zCzV8zseTM7K3U9Mxuf7GnbkX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frmnTpoVuDgAA0AgYpnz99dd16KGHEsRiMDMdeuih9CICAFBD6j6MSSKIFYBnBQBAbRkRYSy0\nLVu26Pjjjy/pGg8//LDOOeecMrUIAADUi4qHMTO7ycxeNrOn044tNbMeM1ub/PPBSrcDAACgFlWj\nZ+yHkj6Q5fg33X1W8s/9VWiHJKmzu0dzl63StMUrNXfZKnV295Tluvv379eFF16oE044Qeedd572\n7dunq6++WieddJKOP/54LVy4UO4uSXr22Wf1/ve/XyeeeKLe+c53avPmzUOu9cQTT2j27Nl67rnn\nytI2AABQuyoextz9l5J2V/o+cXR29+jyu9arZ0+vXFLPnl5dftf6sgSyTZs2aeHChXrqqad08MEH\n67vf/a4uvfRSPfHEE3r66afV29ur++67T5J0wQUX6JJLLtG6dev02GOPaeLEiYPXeeyxx/S5z31O\nd999t44++uiS2wUAABIq1SFTqpA1Y5ea2VPJYcxDok4ys4Vm1mVmXTt37izphtc+sEm9ff1DjvX2\n9evaBzaVdF1Jmjx5subOnStJ+vSnP61HHnlEDz30kObMmaOZM2dq1apV2rBhg1599VX19PToIx/5\niKTEul9jx46VJG3cuFELFy7UvffeqylTppTcJgAAkFDJDplShQpj35P0dkmzJL0o6Z+jTnT36929\nw907JkzIu/F5Tjv29BZ0vBCZsxTNTJ///Od1xx13aP369br44ov1+uuvDw5VZjNx4kSNGTNG3d3d\nJbcHAAC8pZIdMqUKEsbc/SV373f3AUk3SHp3Ne57ZFtrQccLsXXrVv3617+WJC1fvlynnnqqJOmw\nww7T3r17dccdd0iSDj74YE2aNEmdnZ2SpDfeeEP79u2TJLW1tWnlypW64oor9PDDD5fcJgAAkFDJ\nDplSBQljZjYx7duPSHo66txyWjRvhlpbmocca21p1qJ5M0q+9rHHHqubb75ZJ5xwgnbv3q2/+Zu/\n0cUXX6yZM2dq/vz5OumkkwbP/dGPfqRvf/vbOuGEE3TKKafod7/73eBrRxxxhO69915dcsklevzx\nx0tuFwAAqGyHTKks17BZWW5gtlzSaZIOk/SSpCuT38+S5JK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5pctr3kyTtCNSWuuXuO5L/fVnST5X4HxUK81KyDiVVj/Jy4PbUHXd/KfmP+4CkG8TPYU7JOp07\nJd3q7nclD/NzGFO258fPYHHcfY+khyWdLKnNzEYlX6rK72TCWHhPSJqenL0xWtInJd0TuE11xcwO\nTBawyswOlHSmpKdzvwtZ3CPpwuTXF0q6O2Bb6lIqRCR9RPwcRkoWT98oaaO7X5f2Ej+HMUQ9P34G\n4zOzCWbWlvy6VdL7lai9e0jSecnTqvIzyGzKGpCcevwtSc2SbnL3rwRuUl0xs6OV6A2TpFGSfswz\nzM3Mlks6TdJhkl6SdKWkTkm3SZoiaaukj7s7BeoRIp7haUoMD7mkLZI+m6p/wlBmdqqkX0laL2kg\nefgKJeqe+DnMI8fzWyB+BmMxsxOUKNBvVqJz6jZ3vzr5O+UnksZL6pb0aXd/o6JtIYwBAACEwzAl\nAABAQIQxAACAgAhjAAAAARHGAAAAAiKMAQAABEQYA4A0ZnaomT1kZnvN7F9CtwfAyDcq/ykA0FBe\nl/S/JB2f/AMAFUXPGIARz8ymmtkzZnZzcgPlO8xsrJmdZGaPmdk6M/svMzvI3V9z90eUCGUAUHGE\nMQCNYoak6939BEl/lHSppBWSvuDuJyqxFUpvwPYBaFCEMQCNYpu7P5r8+hZJ8yS96O5PSJK7/9Hd\n9wdrHYCGRRgD0Cgy9377Y5ZjAFB1hDEAjWKKmb0n+fUCSaslHWlmJ0mSmR1kZkxqAlB1bBQOYMQz\ns6mS7pf0S0mnSPqtpM9IOk7SdyS1KlEv9n5332tmWyQdLGm0pD2SznT331S94QAaAmEMwIiXDGP3\nuTtLVQCoOQxTAgAABETPGAAAQED0jAEAAAREGAMAAAiIMAYAABAQYQwAACAgwhgAAEBAhDEAAICA\n/j/l1ZH0xwUQSAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xd9d49fdeb8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.clf()\n",
    "plt.figure(figsize = (10, 6))\n",
    "names = ['back', 'neptune']\n",
    "colors = ['#1F77B4', '#FF7F0E']\n",
    "markers = ['o', 's']\n",
    "#label = numpy array of target column\n",
    "plt.title('Principal component 1 vs 2')\n",
    "plt.xlabel('pc1')\n",
    "plt.ylabel('pc2')\n",
    "for i in range(len(names)):\n",
    "    bucket = principalDf[principalDf['target'] == i]\n",
    "    bucket = bucket.iloc[:,[0,1]].values\n",
    "    plt.scatter(bucket[:, 0], bucket[:, 1], c=colors[i], label=names[i], marker=markers[i]) \n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 188,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "target\n",
       "0.0    968\n",
       "1.0    968\n",
       "dtype: int64"
      ]
     },
     "execution_count": 188,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "principalDf.groupby('target').size()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 191,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "50852 new random picked points\n"
     ]
    }
   ],
   "source": [
    "from imblearn.over_sampling import RandomOverSampler\n",
    "\n",
    "ros = RandomOverSampler()\n",
    "X_ros, Y_ros = ros.fit_sample(X, Y)\n",
    "\n",
    "print(X_ros.shape[0] - X.shape[0], 'new random picked points')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 192,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "Y_ros = Y_ros.reshape(-1, 1)\n",
    "X_ros = np.append(X_ros, Y_ros, axis=1)\n",
    "principalDf = pd.DataFrame(data = X_ros, columns = ['principal component 1', 'principal component 2', 'target'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 193,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.figure.Figure at 0xd9be9ba7f0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "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gz19vaquMDuE088oZNOOklHHHGEjjrqKK1Zs+Z1x1q2bJmOPPJIrV27tuV2AQCAdOusMPbK\nYGPbG/DYY4+pt7dXf/7znzV27Fh973vf06WXXqply5bp4Ycf1vbt27Vo0SJJ0gc+8AHNnj1bK1eu\n1NKlSzVx4t/uDrV06VJdfPHFuu2223TwwQe33C4AAJBunRXGEnTQQQfp+OOPlyR98IMf1H333ae7\n775bxx57rA4//HDdddddWrVqlbZu3ap169bp7LPPliR1dXVp7733llS4TVFvb69uv/12TZkyJdh7\nAQAA7UMYi4mZDfv5kksu0c0336yHHnpIF110kXbs2KFq9wKdOHGiurq69OCDDybdXAAAkBKEsZg8\n9dRT+sMf/iBJuuGGG/S2t71NkjR+/HgNDg7q5ptvliSNHTtWkydP1sKFCyVJL7/8srZt2yZJGjdu\nnBYvXqy5c+dqyZIl7X8TAACg7QhjMZk+fbquu+46zZw5U5s3b9bHP/5xXXTRRTr88MN11lln6Zhj\njtm97/XXX69vf/vbmjlzpo477jg9++yzu5874IADdPvtt2v27Nm6//77Q7wVAADQRlat2yxtenp6\nvK+v73XbVq9erenTp9d3gPmTyg/WHzVamrsuhhZmQ0PXDADQUbrnLB62LY03184CM1vu7j219tuz\nHY1JjQ4KXAAANKpcECtuJ5Alh25KAACAgAhjAAAAAeUijGVp3FtoXCsAANIl82Gsq6tLmzZtImTU\nwd21adMmdXV1hW4KAACIZH4A/+TJkzUwMKDnnnsudFMyoaurS5MnTw7dDABACvUvOJ3ZlAFkPoyN\nHDlSU6dODd0MAABygeDVfpkPYwAAIBlUydoj82PGAABA/KqtOYZ4EcYAAAACIowBAAAExJgxAABy\nhHFe2UNlDACAnGCcVzYRxgAAwDCVqmlU2eJHNyUAACiL4NUeVMYAAAACIowBAAAERBgDACAnGOeV\nTYwZAwAgRwhe2UNlDAAAICAqYwAApACLtXYuKmMAAATGYq2djTAGAAAQEGEMAAAgIMaMAQCQIMaC\noRYqYwAAJISxYKgHYQwAgMBYrLWz0U0JAEDMmql8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BgAAEBBhDAAAICDC\nGACUMLP9zOxuMxs0s++Gbg+A/Nuz9i4A0FF2SPo/kmZEXwCQKCpjAHLPzLrN7FEzuy66afLNZra3\nmR1jZkvNbKWZ/cnMxrj7X939PhVCGQAkjjAGoFNMk3SVu8+U9JKkSyXdKOkT7n6ECrdC2R6wfQA6\nFGEMQKd42t1/Hz3+T0mnSHrG3ZdJkru/5O47g7UOQMcijAHoFEPv/fZSmW0A0HaEMQCdYoqZ/bfo\n8fmS/ijpQDM7RpLMbIyZMakJQNtxo3AAuWdm3ZLukHSvpOMkPS7pQ5IOk/QdSXupMF7sJHcfNLN+\nSWMljZK0RdLJ7v5I2xsOoCMQxgDkXhTGFrk7S1UASB26KQEAAAKiMgYAABAQlTEAAICACGMAAAAB\nEcYAAAACIowBAAAERBgDAAAIiDAGAAAQ0P8HB7TNlsvgajAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xd9be9ba7b8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.clf()\n",
    "plt.figure(figsize = (10, 6))\n",
    "names = ['back', 'neptune']\n",
    "colors = ['#1F77B4', '#FF7F0E']\n",
    "markers = ['o', 's']\n",
    "#label = numpy array of target column\n",
    "plt.title('Principal component 1 vs 2')\n",
    "plt.xlabel('pc1')\n",
    "plt.ylabel('pc2')\n",
    "for i in range(len(names)):\n",
    "    bucket = principalDf[principalDf['target'] == i]\n",
    "    bucket = bucket.iloc[:,[0,1]].values\n",
    "    plt.scatter(bucket[:, 0], bucket[:, 1], c=colors[i], label=names[i], marker=markers[i]) \n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 194,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "target\n",
       "0.0    51820\n",
       "1.0    51820\n",
       "dtype: int64"
      ]
     },
     "execution_count": 194,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "principalDf.groupby('target').size()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Under-sampling: Tomek links"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 206,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Removed indexes: [    0     1     2 ..., 52785 52786 52787]\n"
     ]
    }
   ],
   "source": [
    "from imblearn.under_sampling import TomekLinks\n",
    "\n",
    "tl = TomekLinks(return_indices=True, ratio='majority')\n",
    "X_tl, Y_tl, id_tl = tl.fit_sample(X, Y)\n",
    "\n",
    "print('Removed indexes:', id_tl)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 208,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(52788,)"
      ]
     },
     "execution_count": 208,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Y_tl.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 200,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "Y_tl = Y_tl.reshape(-1, 1)\n",
    "X_tl = np.append(X_tl, Y_tl, axis=1)\n",
    "principalDf = pd.DataFrame(data = X_tl, columns = ['principal component 1', 'principal component 2', 'target'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 201,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.figure.Figure at 0xd9d4fafc50>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmMAAAGDCAYAAABnZBdiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3XuYXFWZ7/Hfm06HdAjQBAIDnTQJ\nHshwIJBIY5DIKF4IjKhRQURQeO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eMMBNATCGIC6F4Sxe92dpSoAVB2GKQEAABJE\nzxgAAECC6BkDAABIEGEMAAAgQYQxAACABBHGAAAAEkQYAwAASBBhDAAAIEH/H2TLdb/7hIXgAAAA\nAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xd9d4faf9e8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.clf()\n",
    "plt.figure(figsize = (10, 6))\n",
    "names = ['back', 'neptune']\n",
    "colors = ['#1F77B4', '#FF7F0E']\n",
    "markers = ['o', 's']\n",
    "#label = numpy array of target column\n",
    "plt.title('Principal component 1 vs 2')\n",
    "plt.xlabel('pc1')\n",
    "plt.ylabel('pc2')\n",
    "for i in range(len(names)):\n",
    "    bucket = principalDf[principalDf['target'] == i]\n",
    "    bucket = bucket.iloc[:,[0,1]].values\n",
    "    plt.scatter(bucket[:, 0], bucket[:, 1], c=colors[i], label=names[i], marker=markers[i]) \n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "target\n",
       "0.0      968\n",
       "1.0    51820\n",
       "dtype: int64"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "principalDf.groupby('target').size()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Under-sampling: Cluster Centroids"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from imblearn.under_sampling import ClusterCentroids\n",
    "\n",
    "cc = ClusterCentroids(ratio={1: 968, 0: 500})\n",
    "X_cc, Y_cc = cc.fit_sample(X, Y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1468, 2)"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_cc.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1468,)"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Y_cc.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 231,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 29.62892884,  14.88659951],\n",
       "       [ 25.04042331,  12.55011015],\n",
       "       [ 23.27153278,  11.66499162],\n",
       "       ..., \n",
       "       [ -1.54301872,   0.74372408],\n",
       "       [ -1.18151537,   0.98291305],\n",
       "       [  0.40780625,   1.99713311]])"
      ]
     },
     "execution_count": 231,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_cc"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "Y_cc = Y_cc.reshape(-1, 1)\n",
    "X_cc = np.append(X_cc, Y_cc, axis=1)\n",
    "principalDf = pd.DataFrame(data = X_cc, columns = ['principal component 1', 'principal component 2', 'target'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1468, 3)"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "principalDf.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 235,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.figure.Figure at 0xd9cdbfb630>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmMAAAGDCAYAAABnZBdiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF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b3f0U\nSX+WdKWkpZI+7+6nKrUVSm+C7QPQoAhjABrFFnd/LPj6VknnSHrR3Z+UJHf/s7vvS6x1ABoWYQxA\no8je++3PIccAoOIIYwAaxWQze2fw9UWSVkg6xsxOkyQzO9jMmNQEoOLYKBxA3TOzKZIekPQbSWdI\nelbSpyWdJOl7klqUqhd7n7vvNrNNkg6RNFpSj6Sz3f0PFW84gIZAGANQ94Iwdr+7s1QFgKrDMCUA\nAECC6BkDAABIED1jAAAACSKMAQAAJIgwBgAAkCDCGAAAQIIIYwAAAAkijAEAACTo/wMkEKdkPGZk\nLAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xd9cdbfb710>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.clf()\n",
    "plt.figure(figsize = (10, 6))\n",
    "names = ['back', 'neptune']\n",
    "colors = ['#1F77B4', '#FF7F0E']\n",
    "markers = ['o', 's']\n",
    "#label = numpy array of target column\n",
    "plt.title('Principal component 1 vs 2')\n",
    "plt.xlabel('pc1')\n",
    "plt.ylabel('pc2')\n",
    "for i in range(len(names)):\n",
    "    bucket = principalDf[principalDf['target'] == i]\n",
    "    bucket = bucket.iloc[:,[0,1]].values\n",
    "    plt.scatter(bucket[:, 0], bucket[:, 1], c=colors[i], label=names[i], marker=markers[i]) \n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 236,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "target\n",
       "0.0    968\n",
       "1.0    968\n",
       "dtype: int64"
      ]
     },
     "execution_count": 236,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "principalDf.groupby('target').size()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Over-sampling: SMOTE"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.07482734,  2.85482723],\n",
       "       [ 1.29161521,  4.48340331],\n",
       "       [-4.46892273,  1.58439499],\n",
       "       [-4.37640658,  1.32077222],\n",
       "       [-4.58568763,  2.08676963],\n",
       "       [ 0.04992336,  0.17084613],\n",
       "       [ 0.19673664, -1.02782954],\n",
       "       [ 0.08920261, -1.16326857],\n",
       "       [-0.47134677, -1.2022523 ],\n",
       "       [ 1.2925473 , -3.18552102],\n",
       "       [ 1.08327325, -2.42904712],\n",
       "       [ 5.18581676,  2.26747508],\n",
       "       [ 0.53097045, -1.28411893],\n",
       "       [ 4.33656509,  2.20424516],\n",
       "       [-1.16086933,  0.58101802],\n",
       "       [ 3.38361985, -0.15976077],\n",
       "       [ 0.57277412, -3.12264072],\n",
       "       [-1.19252029, -2.03042714],\n",
       "       [-1.68246398, -1.94888564]])"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from imblearn.over_sampling import SMOTE\n",
    "\n",
    "smote = SMOTE(ratio={0: 50, 1: 50})\n",
    "X_sm, Y_sm = smote.fit_sample(X, Y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(100,)"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Y_sm.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "Y_sm = Y_sm.reshape(-1, 1)\n",
    "X_sm = np.append(X_sm, Y_sm, axis=1)\n",
    "principalDf = pd.DataFrame(data = X_sm, columns = ['principal component 1', 'principal component 2', 'target'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.figure.Figure at 0x34ce678eb8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmMAAAF3CAYAAADpZ0xtAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3X903HW95/HXu2FC0wYJQhU6paS6\nnlhpoKmh9G4PlB9dg2tpQ9ersujV47o9HtejcC5ZWsC19+zS9hqP+IN7jrfnLqwCAhdsA4KeAAu1\ngIJtSWutNfd6vAWa+iNlDVAIkqbv/SOZkB8zk5lkZj7f78zzcQ6HzjffzrzJlM4rn8/78/mYuwsA\nAABhzAhdAAAAQCUjjAEAAAREGAMAAAiIMAYAABAQYQwAACAgwhgAAEBAhDEAAICACGMAAAABEcYA\nAAACIowBAAAEdFLoAvJxxhlneH19fegyAAAAJrVnz56j7j5nsvtiFcbq6+u1e/fu0GUAAABMysxe\nyOU+pikBAAACIowBAAAERBgDAAAIKFY9YwAAILOBgQEdPnxYb775ZuhSKsrMmTM1b948JRKJKf1+\nwhgAAGXi8OHDOuWUU1RfXy8zC11ORXB3vfzyyzp8+LAWLFgwpedgmhIAgDLx5ptv6vTTTyeIlZCZ\n6fTTT5/WaCRhDACAMkIQK73pfs8JYwAAoGBqa2sL8jwbN27U17/+9YI8V77Pu2PHDq1atargr50J\nYQwAACAgwhgAABWqo6tHy7c8oQXrH9HyLU+oo6unYM/t7mpra9OiRYvU2Nio++67T5J07NgxXX75\n5VqyZIkaGxv14IMPjvyeW265RQ0NDVq5cqW6u7tHrl9yySW67rrrdPHFF2vhwoXatWuX1q5dq/e9\n7326+eabR+77xje+oUWLFmnRokX65je/mdPzpk72OXr0qNIdufj666/rs5/9rC644AI1NTWNqbdQ\nWE0JADHX0dWj9s5uHenr19y6GrW1NKi1KRm6LERcR1ePNmzbr/6BQUlST1+/NmzbL0kF+fOzbds2\n7d27V/v27dPRo0d1wQUX6OKLL9acOXO0fft2veMd79DRo0e1bNkyrV69Ws8//7zuvfdedXV16fjx\n41qyZIk++MEPjjxfdXW1du7cqW9961tas2aN9uzZo3e+851673vfq+uuu06HDh3SHXfcoeeee07u\nrgsvvFArVqzQiRMnsj7vZG655RZddtlluv3229XX16elS5dq5cqVmj179rS/RymEMQCIsWJ/oKJ8\ntXd2j/y5SekfGFR7Z3dB/uw8/fTTuvrqq1VVVaV3v/vdWrFihXbt2qUPf/jDuvHGG7Vz507NmDFD\nPT09+uMf/6innnpKV111lWbNmiVJWr169ZjnSz1ubGzUueeeq7POOkuS9J73vEcvvfSSnn76aV11\n1VUjIWnt2rV66qmndOLEiazPO5lHH31UDz300Eif2ZtvvqkXX3xRCxcunPo3ZxzCGADEWLE/UFG+\njvT153U9X+6e9vrdd9+t3t5e7dmzR4lEQvX19SPbQmRblXjyySdLkmbMmDHy69Tj48ePZ3y9bM97\n0kkn6cSJE5KUcWsKd9cPf/hDNTQ0ZHz+6aJnDABirNgfqChfc+tq8rqer4svvlj33XefBgcH1dvb\nq507d2rp0qV65ZVX9K53vUuJREJPPvmkXnjhhZH7t2/frv7+fr322mv60Y9+lPfrdXR06I033tDr\nr7+u7du366KLLsr6vPX19dqzZ48k6YEHHkj7vC0tLfrOd74zEva6urqm8u3IipExAIixuXU16kkT\nvAr1gYry1dbSMGaKW5JqElVqaynMCNBVV12ln//85zr//PNlZvra176mM888U9dcc42uvPJKNTc3\na/HixXr/+98vSVqyZIk+/vGPa/HixTrnnHN00UUX5fV6S5Ys0Wc+8xktXbpUkvS5z31OTU1NkpTx\nea+//np97GMf05133qnLLrss7fN+5Stf0bXXXqvzzjtP7q76+no9/PDDU/mWZGTZhvWiprm52VOr\nHgAAE3vGpKEP1M1rG5mmrEAHDx7Mq5eJxR+Fk+57b2Z73L15st/LyBgAxFjqg5MPVExFa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": [
       "<matplotlib.figure.Figure at 0x34ce678e80>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.clf()\n",
    "plt.figure(figsize = (10, 6))\n",
    "names = ['loadmodule', 'rootkit']\n",
    "colors = ['#1F77B4', '#FF7F0E']\n",
    "markers = ['o', 's']\n",
    "#label = numpy array of target column\n",
    "plt.xlabel('pc1')\n",
    "plt.ylabel('pc2')\n",
    "for i in range(len(names)):\n",
    "    bucket = principalDf[principalDf['target'] == i]\n",
    "    bucket = bucket.iloc[:,[0,1]].values\n",
    "    plt.scatter(bucket[:, 0], bucket[:, 1], c=colors[i], label=names[i], marker=markers[i]) \n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
